DROP DATABASE IF EXISTS `mingyue_springcloud`;

CREATE DATABASE `mingyue_springcloud` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

USE `mingyue_springcloud`;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- 1、用户信息表
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
    `user_id`      BIGINT(20)       NOT NULL        COMMENT '用户ID',
    `username`     VARCHAR(64)      NOT NULL        COMMENT '用户名',
    `nickname`     VARCHAR(64)      NOT NULL        COMMENT '用户昵称',
    `sex`          CHAR(1)          DEFAULT '0'     COMMENT '用户性别（0男 1女 2未知）',
    `password`     VARCHAR(255)     NOT NULL        COMMENT '密码',
    `phone`        VARCHAR(32)      DEFAULT NULL    COMMENT '手机号码',
    `email`        VARCHAR(32)      DEFAULT NULL    COMMENT '用户邮箱',
    `avatar`       VARCHAR(255)     DEFAULT NULL    COMMENT '头像',
    `status`       CHAR(1)          DEFAULT '0'     COMMENT '帐号状态（0正常 1停用）',
    `is_deleted`   CHAR(1)          DEFAULT '0'     COMMENT '删除标志（0正常，1删除）',
    `create_time`  DATETIME         DEFAULT NULL    COMMENT '创建时间',
    `update_time`  DATETIME         DEFAULT NULL    COMMENT '修改时间',
    `create_by`    VARCHAR(64)      DEFAULT NULL    COMMENT '创建者',
    `update_by`    VARCHAR(64)      DEFAULT NULL    COMMENT '更新人',
    PRIMARY KEY (`user_id`),
    KEY `user_idx1_username` (`username`)
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT = '用户表';

BEGIN;
INSERT INTO `sys_user` VALUES (1, 'mingyue', '明月', '0', '$2a$12$pBVti6NTcVJxptxHNqetBewxqwJU54.sItx3b8U2Kl44XnQinfUHq', '13288888888', 'xxxxxx@qq.com', 'https://p26-passport.byteacctimg.com/img/user-avatar/895aa57161ffee930f39afb35fec77eb~180x180.awebp', '0', '0', '2023-07-19 17:06:22', '2023-07-19 17:06:25', 'mingyue', 'mingyue');
INSERT INTO `sys_user` VALUES (2, 'strive', 'Strive', '0', '$2a$12$pBVti6NTcVJxptxHNqetBewxqwJU54.sItx3b8U2Kl44XnQinfUHq', '15388888888', NULL, NULL, '0', '0', '2023-07-19 17:06:22', '2023-07-19 17:06:25', 'mingyue', 'mingyue');
COMMIT;

-- ----------------------------
-- 2、角色信息表
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE sys_role (
    `role_id`       BIGINT(20)      NOT NULL         COMMENT '角色ID',
    `role_name`     VARCHAR(64)     NOT NULL         COMMENT '角色名称',
    `role_code`     VARCHAR(64)     NOT NULL         COMMENT '角色代码',
    `order_num`     INT(4)          NOT NULL         COMMENT '显示顺序',
    `status`        CHAR(1)         DEFAULT '0'      COMMENT '角色状态（0正常 1停用）',
    `role_desc`     VARCHAR(255)    DEFAULT NULL     COMMENT '角色描述',
    `is_deleted`    CHAR(1)         DEFAULT '0'      COMMENT '删除标志（0正常，1删除）',
    `create_time`   DATETIME        DEFAULT NULL     COMMENT '创建时间',
    `update_time`   DATETIME        DEFAULT NULL     COMMENT '修改时间',
    `create_by`     VARCHAR(64)     DEFAULT NULL     COMMENT '创建者',
    `update_by`     VARCHAR(64)     DEFAULT NULL     COMMENT '更新人',
    PRIMARY KEY (`role_id`),
    UNIQUE KEY `role_idx1_role_code` (`role_code`)
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT = '角色表';

BEGIN;
INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 0, '0', NULL, '0', '2023-07-19 17:06:22', '2023-07-19 17:06:25', 'mingyue', 'mingyue');
INSERT INTO `sys_role` VALUES (2, '普通用户', 'common', 1, '0', NULL, '0', '2023-07-19 17:06:22', '2023-07-19 17:06:25', 'mingyue', 'mingyue');
COMMIT;

-- ----------------------------
-- 3、用户和角色关联表
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE sys_user_role (
    `user_id`   BIGINT(20) NOT NULL COMMENT '用户ID',
    `role_id`   BIGINT(20) NOT NULL COMMENT '角色ID',
    PRIMARY KEY (`user_id`, `role_id`)
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT = '用户和角色关联表';

BEGIN;
INSERT INTO `sys_user_role` VALUES (1, 1);
INSERT INTO `sys_user_role` VALUES (2, 2);
COMMIT;

-- ----------------------------
-- 4、菜单权限表
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
    `menu_id`        BIGINT(20)    NOT NULL                COMMENT '菜单名称',
    `menu_name`      VARCHAR(64)   NOT NULL                COMMENT '菜单名称',
    `parent_id`      BIGINT(20)    DEFAULT NULL            COMMENT '父菜单ID',
    `permission`     VARCHAR(32)   DEFAULT NULL            COMMENT '权限标识',
    `type`           CHAR(1)       DEFAULT NULL            COMMENT '菜单类型（0菜单 1按钮）',
    `order_num`      INT(4)        NOT NULL DEFAULT '0'    COMMENT '排序值',
    `path`           VARCHAR(128)  DEFAULT NULL            COMMENT '路由地址（前端URL)',
    `component`      VARCHAR(255)  DEFAULT NULL            COMMENT '组件路径',
    `redirect`       VARCHAR(255)  DEFAULT NULL            COMMENT '重定向路径',
    `is_link`        VARCHAR(128)  DEFAULT NULL            COMMENT '是否为外链（0否 1是）',
    `is_hide`        CHAR(1)       DEFAULT '0'             COMMENT '是否隐藏（0否 1是）',
    `is_keep_alive`  CHAR(1)       DEFAULT '0'             COMMENT '是否开启缓存（0否 1是）',
    `is_affix`       CHAR(1)       DEFAULT '0'             COMMENT '是否固定（0否 1是）',
    `is_iframe`      CHAR(1)       DEFAULT '0'             COMMENT '是否内嵌（0否 1是）',
    `status`         CHAR(1)       DEFAULT '0'             COMMENT '菜单状态（0正常 1停用）',
    `icon`           VARCHAR(64)   DEFAULT NULL            COMMENT '图标',
    `is_deleted`     CHAR(1)       DEFAULT '0'             COMMENT '删除标志（0正常，1删除）',
    `create_time`    DATETIME      DEFAULT NULL            COMMENT '创建时间',
    `update_time`    DATETIME      DEFAULT NULL            COMMENT '修改时间',
    `create_by`      VARCHAR(64)   DEFAULT NULL            COMMENT '创建者',
    `update_by`      VARCHAR(64)   DEFAULT NULL            COMMENT '更新人',
    PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='菜单权限表';

BEGIN;
INSERT INTO `sys_menu` VALUES (0, 'message.router.home', -1, NULL, '0', 0, 'home', 'home/index', NULL, NULL, '0', '1', '1', '0', '0', 'iconfont icon-shouye', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (1, 'message.router.system', -1, NULL, '0', 1, 'system', 'layout/routerView/parent', '/system/menu', NULL, '0', '0', '0', '0', '0', 'iconfont icon-xitongshezhi', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (110, 'message.router.systemUser', 1, 'system:user:list', '0', 0, 'system/user', '/system/user/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-icon-', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (120, 'message.router.systemRole', 1, NULL, '0', 1, 'system/role', 'system/role/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-ColdDrink', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (130, 'message.router.systemMenu', 1, NULL, '0', 2, 'system/menu', 'system/menu/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-caidan', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (140, 'message.router.systemDept', 1, NULL, '0', 3, 'system/dept', 'system/dept/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-OfficeBuilding', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (150, 'message.router.systemDic', 1, NULL, '0', 4, 'system/dic', 'system/dic/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-OfficeBuilding', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');

INSERT INTO `sys_menu` VALUES (2, 'message.router.funIndex', -1, NULL, '0', 2, 'fun', 'layout/routerView/parent', '/fun/tagsView', NULL, '0', '1', '0', '0', '0', 'iconfont icon-crew_feature', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (210, 'message.router.funTagsView', 2, NULL, '0', 0, 'fun/tagsView', 'fun/tagsView/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Pointer', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (220, 'message.router.funCountup', 2, NULL, '0', 1, 'fun/countup', 'fun/countup/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Odometer', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (230, 'message.router.funWangEditor', 2, NULL, '0', 2, 'fun/wangEditor', 'fun/wangEditor/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-fuwenbenkuang', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (240, 'message.router.funCropper', 2, NULL, '0', 3, 'fun/cropper', 'fun/cropper/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-caijian', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (250, 'message.router.funQrcode', 2, NULL, '0', 4, 'fun/qrcode', 'fun/qrcode/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-ico', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (260, 'message.router.funEchartsMap', 2, NULL, '0', 5, 'fun/echartsMap', 'fun/echartsMap/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-ditu', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (270, 'message.router.funPrintJs', 2, NULL, '0', 6, 'fun/printJs', 'fun/printJs/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Printer', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (280, 'message.router.funClipboard', 2, NULL, '0', 7, 'fun/clipboard', 'fun/clipboard/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-DocumentCopy', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (290, 'message.router.funGridLayout', 2, NULL, '0', 8, 'fun/gridLayout', 'fun/gridLayout/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-tuodong', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (211, 'message.router.funSplitpanes', 2, NULL, '0', 9, 'fun/splitpanes', 'fun/splitpanes/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon--chaifenlie', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');

INSERT INTO `sys_menu` VALUES (3, 'message.router.pagesIndex', -1, NULL, '0', 3, 'pages', 'layout/routerView/parent', '/pages/filtering', NULL, '0', '1', '0', '0', '0', 'iconfont icon-fuzhiyemian', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (310, 'message.router.pagesFiltering', 3, NULL, '0', 0, 'pages/filtering', 'pages/filtering/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Sell', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (3101, 'message.router.pagesFilteringDetails1', 310, NULL, '0', 0, 'pages/filtering/details1', 'pages/filtering/details1', NULL, NULL, '1', '0', '0', '0', '0', 'ele-Sunny', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (320, 'message.router.pagesFilteringDetails2', 3, NULL, '0', 1, 'pages/filtering/details2', 'pages/filtering/details2', NULL, NULL, '1', '0', '0', '0', '0', 'ele-Sunny', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (330, 'message.router.pagesIocnfont', 3, NULL, '0', 2, 'pages/iocnfont', 'pages/iocnfont/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Present', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (340, 'message.router.pagesElement', 3, NULL, '0', 3, 'pages/element', 'pages/element/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Eleme', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (350, 'message.router.pagesAwesome', 3, NULL, '0', 4, 'pages/awesome', 'pages/awesome/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-SetUp', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (360, 'message.router.pagesFormAdapt', 3, NULL, '0', 5, 'pages/formAdapt', 'pages/formAdapt/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-biaodan', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (370, 'message.router.pagesTableRules', 3, NULL, '0', 6, 'pages/tableRules', 'pages/tableRules/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-jiliandongxuanzeqi', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (380, 'message.router.pagesFormI18n', 3, NULL, '0', 7, 'pages/formI18n', 'pages/formI18n/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-diqiu', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (390, 'message.router.pagesFormRules', 3, NULL, '0', 8, 'pages/formRules', 'pages/formRules/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-shuxing', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (311, 'message.router.pagesListAdapt', 3, NULL, '0', 9, 'pages/listAdapt', 'pages/listAdapt/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-chazhaobiaodanliebiao', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (312, 'message.router.pagesWaterfall', 3, NULL, '0', 10, 'pages/waterfall', 'pages/waterfall/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-zidingyibuju', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (313, 'message.router.pagesSteps', 3, NULL, '0', 11, 'pages/steps', 'pages/steps/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-step', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (314, 'message.router.pagesPreview', 3, NULL, '0', 12, 'pages/preview', 'pages/preview/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-15tupianyulan', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (315, 'message.router.pagesWaves', 3, NULL, '0', 13, 'pages/waves', 'pages/waves/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-bolangneng', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (316, 'message.router.pagesTree', 3, NULL, '0', 14, 'pages/tree', 'pages/tree/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-shuxingtu', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (317, 'message.router.pagesDrag', 3, NULL, '0', 15, 'pages/drag', 'pages/drag/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Pointer', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (318, 'message.router.pagesLazyImg', 3, NULL, '0', 16, 'pages/lazyImg', 'pages/lazyImg/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-PictureFilled', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (319, 'message.router.pagesDynamicForm', 3, NULL, '0', 17, 'pages/dynamicForm', 'pages/dynamicForm/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-wenducanshu-05', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (321, 'message.router.pagesWorkflow', 3, NULL, '0', 18, 'pages/workflow', 'pages/workflow/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Connection', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');

INSERT INTO `sys_menu` VALUES (4, 'message.router.makeIndex', -1, NULL, '0', 4, 'make', 'layout/routerView/parent', '/make/selector', NULL, '0', '1', '0', '0', '0', 'iconfont icon-siweidaotu', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (410, 'message.router.makeSelector', 4, NULL, '0', 0, 'make/selector', 'make/selector/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-xuanzeqi', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (420, 'message.router.makeNoticeBar', 4, NULL, '0', 1, 'make/noticeBar', 'make/noticeBar/index', NULL, NULL, '0', '1', '0', '0', '0', 'ele-Bell', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (430, 'message.router.makeSvgDemo', 4, NULL, '0', 2, 'make/svgDemo', 'make/svgDemo/index', NULL, NULL, '0', '1', '0', '0', '0', 'fa fa-thumbs-o-up', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (440, 'message.router.makeTableDemo', 4, NULL, '0', 3, 'make/tableDemo', 'make/tableDemo/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-shuju', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');

INSERT INTO `sys_menu` VALUES (5, 'message.router.paramsIndex', -1, NULL, '0', 5, 'params', 'layout/routerView/parent', 'params/common', NULL, '0', '1', '0', '0', '0', 'iconfont icon-zhongduancanshu', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (510, 'message.router.paramsCommon', 5, NULL, '0', 0, 'params/common', 'params/common/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-putong', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (520, 'message.router.paramsCommonDetails', 5, NULL, '0', 1, 'params/common/details', 'params/common/details', NULL, NULL, '1', '1', '0', '0', '0', 'ele-Comment', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (530, 'message.router.paramsDynamic', 5, NULL, '0', 2, 'params/dynamic', 'params/dynamic/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-dongtai', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (540, 'message.router.paramsDynamicDetails', 5, NULL, '0', 3, 'params/dynamic/details/:t/:id/:tagsViewName', 'params/dynamic/details', NULL, NULL, '1', '1', '0', '0', '0', 'iconfont icon-dongtai', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');

INSERT INTO `sys_menu` VALUES (6, 'message.router.visualizingIndex', -1, NULL, '0', 6, 'visualizing', 'layout/routerView/parent', 'visualizing/visualizingLinkDemo1', NULL, '0', '1', '0', '0', '0', 'ele-ChatLineRound', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (610, 'message.router.visualizingLinkDemo1', 6, NULL, '0', 0, 'visualizing/visualizingLinkDemo1', 'layout/routerView/link', NULL, '/visualizingDemo1', '0', '0', '0', '0', '0', 'iconfont icon-caozuo-wailian', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (620, 'message.router.visualizingLinkDemo2', 6, NULL, '0', 1, 'visualizing/visualizingLinkDemo2', 'layout/routerView/link', NULL, '/visualizingDemo2', '0', '0', '0', '0', '0', 'iconfont icon-caozuo-wailian', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (630, 'message.router.chartIndex', 6, NULL, '0', 1, 'chart', 'views/chart/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-ico_shuju', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');

INSERT INTO `sys_menu` VALUES (7, 'message.router.personal', -1, NULL, '0', 7, 'personal', 'personal/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-gerenzhongxin', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (8, 'message.router.tools', -1, NULL, '0', 8, 'tools', 'tools/index', NULL, NULL, '0', '1', '0', '0', '0', 'iconfont icon-gongju', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (9, 'message.router.layoutLinkView', -1, NULL, '0', 9, 'link', 'routerView/link', NULL, 'https://gitee.com/csps/mingyue', '0', '0', '0', '0', '0', 'iconfont icon-caozuo-wailian', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (10, 'message.router.layoutIframeViewOne', -1, NULL, '0', 10, 'iframesOne', 'routerView/iframes', NULL, 'https://juejin.cn/user/2154698523281463', '0', '1', '1', '1', '0', 'iconfont icon-neiqianshujuchucun', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
INSERT INTO `sys_menu` VALUES (11, 'message.router.layoutIframeViewTwo', -1, NULL, '0', 11, 'iframesTwo', 'routerView/iframes', NULL, 'https://blog.csdn.net/csp732171109?spm=1010.2135.3001.5343', '0', '1', '1', '1', '0', 'iconfont icon-neiqianshujuchucun', '0', '2023-07-20 17:00:49', '2023-07-20 17:01:09', 'mingyue', 'mingyue');
COMMIT;

-- ----------------------------
-- 5、角色和菜单关联表
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE sys_role_menu (
    `role_id`   BIGINT(20) NOT NULL COMMENT '角色ID',
    `menu_id`   BIGINT(20) NOT NULL COMMENT '菜单ID',
    PRIMARY KEY (`role_id`, `menu_id`)
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT = '角色和菜单关联表';

BEGIN;
INSERT INTO `sys_role_menu` VALUES (1, 0);
INSERT INTO `sys_role_menu` VALUES (1, 1);
INSERT INTO `sys_role_menu` VALUES (1, 110);
INSERT INTO `sys_role_menu` VALUES (1, 120);
INSERT INTO `sys_role_menu` VALUES (1, 130);
INSERT INTO `sys_role_menu` VALUES (1, 140);
INSERT INTO `sys_role_menu` VALUES (1, 150);
INSERT INTO `sys_role_menu` VALUES (1, 2);
INSERT INTO `sys_role_menu` VALUES (1, 210);
INSERT INTO `sys_role_menu` VALUES (1, 220);
INSERT INTO `sys_role_menu` VALUES (1, 230);
INSERT INTO `sys_role_menu` VALUES (1, 240);
INSERT INTO `sys_role_menu` VALUES (1, 250);
INSERT INTO `sys_role_menu` VALUES (1, 260);
INSERT INTO `sys_role_menu` VALUES (1, 270);
INSERT INTO `sys_role_menu` VALUES (1, 280);
INSERT INTO `sys_role_menu` VALUES (1, 290);
INSERT INTO `sys_role_menu` VALUES (1, 211);
INSERT INTO `sys_role_menu` VALUES (1, 3);
INSERT INTO `sys_role_menu` VALUES (1, 310);
INSERT INTO `sys_role_menu` VALUES (1, 3101);
INSERT INTO `sys_role_menu` VALUES (1, 320);
INSERT INTO `sys_role_menu` VALUES (1, 330);
INSERT INTO `sys_role_menu` VALUES (1, 340);
INSERT INTO `sys_role_menu` VALUES (1, 350);
INSERT INTO `sys_role_menu` VALUES (1, 360);
INSERT INTO `sys_role_menu` VALUES (1, 370);
INSERT INTO `sys_role_menu` VALUES (1, 380);
INSERT INTO `sys_role_menu` VALUES (1, 390);
INSERT INTO `sys_role_menu` VALUES (1, 311);
INSERT INTO `sys_role_menu` VALUES (1, 312);
INSERT INTO `sys_role_menu` VALUES (1, 313);
INSERT INTO `sys_role_menu` VALUES (1, 314);
INSERT INTO `sys_role_menu` VALUES (1, 315);
INSERT INTO `sys_role_menu` VALUES (1, 316);
INSERT INTO `sys_role_menu` VALUES (1, 317);
INSERT INTO `sys_role_menu` VALUES (1, 318);
INSERT INTO `sys_role_menu` VALUES (1, 319);
INSERT INTO `sys_role_menu` VALUES (1, 321);
INSERT INTO `sys_role_menu` VALUES (1, 4);
INSERT INTO `sys_role_menu` VALUES (1, 410);
INSERT INTO `sys_role_menu` VALUES (1, 420);
INSERT INTO `sys_role_menu` VALUES (1, 430);
INSERT INTO `sys_role_menu` VALUES (1, 440);
INSERT INTO `sys_role_menu` VALUES (1, 5);
INSERT INTO `sys_role_menu` VALUES (1, 510);
INSERT INTO `sys_role_menu` VALUES (1, 520);
INSERT INTO `sys_role_menu` VALUES (1, 530);
INSERT INTO `sys_role_menu` VALUES (1, 540);
INSERT INTO `sys_role_menu` VALUES (1, 6);
INSERT INTO `sys_role_menu` VALUES (1, 610);
INSERT INTO `sys_role_menu` VALUES (1, 620);
INSERT INTO `sys_role_menu` VALUES (1, 630);
INSERT INTO `sys_role_menu` VALUES (1, 7);
INSERT INTO `sys_role_menu` VALUES (1, 8);
INSERT INTO `sys_role_menu` VALUES (1, 9);
INSERT INTO `sys_role_menu` VALUES (1, 10);
INSERT INTO `sys_role_menu` VALUES (1, 11);
INSERT INTO `sys_role_menu` VALUES (1, 12);

INSERT INTO `sys_role_menu` VALUES (2, 0);
INSERT INTO `sys_role_menu` VALUES (2, 1);
INSERT INTO `sys_role_menu` VALUES (2, 110);
COMMIT;

-- ----------------------------
-- 6、OSS对象存储表
-- ----------------------------
DROP TABLE IF EXISTS sys_oss;
CREATE TABLE sys_oss (
    oss_id           BIGINT(20)        NOT NULL                   COMMENT 'OSS对象ID',
    file_name        VARCHAR(255)      NOT NULL DEFAULT ''        COMMENT '文件名',
    original_name    VARCHAR(255)      NOT NULL DEFAULT ''        COMMENT '原名',
    file_suffix      VARCHAR(10)       NOT NULL DEFAULT ''        COMMENT '文件后缀名',
    file_url         VARCHAR(500)      NOT NULL                   COMMENT '文件URL',
    create_time      DATETIME          DEFAULT NULL               COMMENT '创建时间',
    create_by        VARCHAR(64)       DEFAULT ''                 COMMENT '上传人',
    update_time      DATETIME          DEFAULT NULl               COMMENT '更新时间',
    update_by        VARCHAR(64)       DEFAULT ''                 COMMENT '更新人',
    service          VARCHAR(20)       NOT NULL DEFAULT 'minio'   COMMENT '服务商',
    primary key (oss_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='OSS对象存储表';

-- ----------------------------
-- 7、OSS对象存储动态配置表
-- ----------------------------
DROP TABLE IF EXISTS sys_oss_config;
CREATE TABLE sys_oss_config (
    oss_config_id     BIGINT(20)         NOT NULL                 COMMENT 'OSS动态配置ID',
    config_key        VARCHAR(20)        NOT NULL DEFAULT ''      COMMENT '配置key',
    access_key        VARCHAR(255)       DEFAULT ''               COMMENT 'accessKey',
    secret_key        VARCHAR(255)       DEFAULT ''               COMMENT '秘钥',
    bucket_name       VARCHAR(255)       DEFAULT ''               COMMENT '桶名称',
    prefix            VARCHAR(255)       DEFAULT ''               COMMENT '前缀',
    endpoint          VARCHAR(255)       DEFAULT ''               COMMENT '访问站点',
    domain            VARCHAR(255)       DEFAULT ''               COMMENT '自定义域名',
    is_https          CHAR(1)            DEFAULT 'N'              COMMENT '是否https（Y是 N否）',
    region            VARCHAR(255)       DEFAULT ''               COMMENT '域',
    access_policy     CHAR(1)            NOT NULL DEFAULT '1'     COMMENT '桶权限类型(0-private 1-public 2-custom)',
    status            CHAR(1)            DEFAULT '1'              COMMENT '是否默认（0是 1否）',
    extend            VARCHAR(255)       DEFAULT ''               COMMENT '扩展字段',
    create_by         VARCHAR(64)        DEFAULT ''               COMMENT '创建者',
    create_time       DATETIME           DEFAULT NULL             COMMENT '创建时间',
    update_by         VARCHAR(64)        DEFAULT ''               COMMENT '更新者',
    update_time       DATETIME           DEFAULT NULL             COMMENT '更新时间',
    PRIMARY KEY (oss_config_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='OSS对象存储动态配置表';

INSERT INTO `sys_oss_config` VALUES (1, 'minio', 'd6zVm5AP07uGCqSmsTxe', 'Vsm6qQDHgGchukEpyEoeX3dTe7fic60nTi8D9a0I', 'mingyue', '', 'mingyue-minio:9000', '', 'N', '', '1', '0', '', 'admin', '2023-09-11 17:50:40', 'admin', '2023-09-11 17:50:40');
COMMIT;

-- ----------------------------
-- 8、系统操作日志
-- ----------------------------
DROP TABLE IF EXISTS sys_operate_log;
CREATE TABLE sys_operate_log (
    operate_log_id    BIGINT(20)         NOT NULL                 COMMENT '操作日志ID',
    module            VARCHAR(50)        DEFAULT ''               COMMENT '模块',
    business_type     INT(2)             DEFAULT 0                COMMENT '业务类型（0其它 1新增 2修改 3删除）',
    method            VARCHAR(100)       DEFAULT ''               COMMENT '方法名称',
    service_id        VARCHAR(32)        DEFAULT NULL             COMMENT '服务ID',
    user_id           BIGINT(20)         NOT NULL                 COMMENT '用户ID',
    user_name         VARCHAR(50)        NOT NULL                 COMMENT '用户账号',
    user_type         TINYINT(1)         DEFAULT 0                COMMENT '用户类型（0其它 1系统用户）',
    user_agent        VARCHAR(1000)      DEFAULT NULL             COMMENT '用户代理',
    req_ip            VARCHAR(128)       DEFAULT ''               COMMENT '请求IP',
    req_address       VARCHAR(255)       DEFAULT ''               COMMENT '请求地点',
    req_url           VARCHAR(255)       DEFAULT ''               COMMENT '请求URL',
    req_method        VARCHAR(20)        DEFAULT NULL             COMMENT '请求方式',
    req_params        TEXT               DEFAULT NULL             COMMENT '请求参数',
    duration          BIGINT             NOT NULL                 COMMENT '执行时长，单位（ms）',
    resp_code         INT                DEFAULT NULL             COMMENT '结果码',
    resp_msg          VARCHAR(512)       NULL DEFAULT ''          COMMENT '结果提示',
    resp_result       VARCHAR(2000)      DEFAULT ''               COMMENT '返回参数',
    status            CHAR(1)            DEFAULT 0                COMMENT '操作状态（0正常 1异常）',
    exception         TEXT               DEFAULT NULL             COMMENT '异常信息',
    operate_time      DATETIME           NOT NULL                 COMMENT '操作时间',
    is_deleted        CHAR(1)            DEFAULT '0'              COMMENT '删除标志（0正常，1删除）',
    create_by         VARCHAR(64)        DEFAULT ''               COMMENT '创建者',
    create_time       DATETIME           DEFAULT NULL             COMMENT '创建时间',
    update_by         VARCHAR(64)        DEFAULT ''               COMMENT '更新者',
    update_time       DATETIME           DEFAULT NULL             COMMENT '更新时间',
    PRIMARY KEY (operate_log_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='系统操作日志';


-- ----------------------------
-- 9、系统登录日志
-- ----------------------------
DROP TABLE if EXISTS sys_login_log;
CREATE TABLE sys_login_log (
   login_log_id       BIGINT(20)         NOT NULL                COMMENT '访问ID',
   log_type           INT(3)             NOT NULL                COMMENT '日志类型',
   user_id            BIGINT(20)         NOT NULL DEFAULT 0      COMMENT '用户编号',
   user_name          VARCHAR(50)        DEFAULT ''              COMMENT '用户账号',
   user_type          TINYINT(1)         DEFAULT 0               COMMENT '用户类型（0其它 1系统用户）',
   req_ip             VARCHAR(128)       DEFAULT ''              COMMENT '请求IP',
   req_address        VARCHAR(255)       DEFAULT ''              COMMENT '请求地点',
   user_agent         VARCHAR(1000)      DEFAULT NULL            COMMENT '用户代理',
   result             TINYINT(1)         NOT NULL                COMMENT '登陆结果',
   is_deleted         CHAR(1)            DEFAULT '0'             COMMENT '删除标志（0正常，1删除）',
   create_by          VARCHAR(64)        DEFAULT ''              COMMENT '创建者',
   create_time        DATETIME           DEFAULT NULL            COMMENT '创建时间',
   update_by          VARCHAR(64)        DEFAULT ''              COMMENT '更新者',
   update_time        DATETIME           DEFAULT NULL            COMMENT '更新时间',
   PRIMARY KEY (login_log_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='系统访问记录';

SET FOREIGN_KEY_CHECKS = 1;
